---------------------------------------------
---- Raeli's Spell Announcer Monk Module ----
---------------------------------------------
local RSA = LibStub("AceAddon-3.0"):GetAddon("RSA")
local L = LibStub("AceLocale-3.0"):GetLocale("RSA")
local RSA_Monk = RSA:NewModule("Monk")
function RSA_Monk:OnInitialize()
	if RSA.db.profile.General.Class == "MONK" then
		RSA_Monk:SetEnabledState(true)
	else
		RSA_Monk:SetEnabledState(false)
	end
end -- End OnInitialize
function RSA_Monk:OnEnable()
local spellinfo
local spelllinkinfo
local extraspellinfo
local extraspellinfolink
RSA.db.profile.Modules.Monk = true -- Set state to loaded, to know if we should announce when a spell is refreshed.
local pName = UnitName("player")
local function Monk_Spells(_, _, _, event, _, _, source, _, _, destGUID, dest, _, _, spellID, spellName, _, missType)
	local petName = UnitName("pet")
	if source == pName or source == petName then
		if (event == "SPELL_CAST_SUCCESS" and RSA.db.profile.Modules.Reminders_Loaded == true) then -- Reminder Refreshed
			local ReminderSpell = RSA.db.profile.Monk.Reminders.SpellName
			if spellName == ReminderSpell and (dest == pName or dest == nil) then
				RSA_Reminder:SetScript("OnUpdate", nil)
				if RSA.db.profile.Reminders.RemindChannels.Chat == true then
					RSA_Print_Self(ReminderSpell .. L[" Refreshed!"])
				end
				if RSA.db.profile.Reminders.RemindChannels.RaidWarn == true then
					RSA_Print_Self_RW(ReminderSpell .. L[" Refreshed!"])
				end
			end
		end -- BUFF REMINDER
		if event == "SPELL_CAST_SUCCESS" then
			if spellID == 115546 then -- PROVOKE
				spellinfo = GetSpellInfo(spellID)
				spelllinkinfo = GetSpellLink(spellID)
				RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo, ["[TARGET]"] = dest,}
				if UnitName(dest) == "Statue of the Black Ox" and RSA.db.profile.Monk.Spells.Provoke.Messages.StatueOfTheBlackOx ~= "" then -- FIND OUT HOW TO OBTAIN NAME, ID OR WHATEVER
					if RSA.db.profile.Monk.Spells.Provoke.Local == true then
						RSA_Print_LibSink(string.gsub(RSA.db.profile.Monk.Spells.Provoke.Messages.StatueOfTheBlackOx, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Provoke.CustomChannel.Enabled == true then
						RSA_Print_Channel(string.gsub(RSA.db.profile.Monk.Spells.Provoke.Messages.StatueOfTheBlackOx, ".%a+.", RSA_String_Replace), RSA.db.profile.Monk.Spells.Provoke.CustomChannel.Channel)
					end
					if RSA.db.profile.Monk.Spells.Provoke.Smart.Say == true then
						RSA_Print_Say(string.gsub(RSA.db.profile.Monk.Spells.Provoke.Messages.StatueOfTheBlackOx, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Provoke.Smart.RaidParty == true then
						RSA_Print_Smart_RaidParty(string.gsub(RSA.db.profile.Monk.Spells.Provoke.Messages.StatueOfTheBlackOx, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Provoke.Party == true then
						if RSA.db.profile.Monk.Spells.Provoke.Smart.RaidParty == true and GetNumGroupMembers() == 0 and InstanceType ~= "arena" then return end
							RSA_Print_Party(string.gsub(RSA.db.profile.Monk.Spells.Provoke.Messages.StatueOfTheBlackOx, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Provoke.Raid == true then
						if RSA.db.profile.Monk.Spells.Provoke.Smart.RaidParty == true and GetNumGroupMembers() > 0 then return end
						RSA_Print_Raid(string.gsub(RSA.db.profile.Monk.Spells.Provoke.Messages.StatueOfTheBlackOx, ".%a+.", RSA_String_Replace))
					end
				end
			end -- PROVOKE
			if spellID == 119582 then -- PURIFYING BREW
				spellinfo = GetSpellInfo(spellID)
				spelllinkinfo = GetSpellLink(spellID)
				RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo,}
				if RSA.db.profile.Monk.Spells.PurifyingBrew.Messages.Start ~= "" then
					if RSA.db.profile.Monk.Spells.PurifyingBrew.Local == true then
						RSA_Print_LibSink(string.gsub(RSA.db.profile.Monk.Spells.PurifyingBrew.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.PurifyingBrew.CustomChannel.Enabled == true then
						RSA_Print_Channel(string.gsub(RSA.db.profile.Monk.Spells.PurifyingBrew.Messages.Start, ".%a+.", RSA_String_Replace), RSA.db.profile.Monk.Spells.PurifyingBrew.CustomChannel.Channel)
					end
					if RSA.db.profile.Monk.Spells.PurifyingBrew.Smart.Say == true then
						RSA_Print_Say(string.gsub(RSA.db.profile.Monk.Spells.PurifyingBrew.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.PurifyingBrew.Smart.RaidParty == true then
						RSA_Print_Smart_RaidParty(string.gsub(RSA.db.profile.Monk.Spells.PurifyingBrew.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.PurifyingBrew.Party == true then
						if RSA.db.profile.Monk.Spells.PurifyingBrew.Smart.RaidParty == true and GetNumGroupMembers() == 0 and InstanceType ~= "arena" then return end
							RSA_Print_Party(string.gsub(RSA.db.profile.Monk.Spells.PurifyingBrew.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.PurifyingBrew.Raid == true then
						if RSA.db.profile.Monk.Spells.PurifyingBrew.Smart.RaidParty == true and GetNumGroupMembers() > 0 then return end
						RSA_Print_Raid(string.gsub(RSA.db.profile.Monk.Spells.PurifyingBrew.Messages.Start, ".%a+.", RSA_String_Replace))
					end
				end
			end -- PURIFYING BREW
		end -- IF EVENT IS SPELL_CAST_SUCCESS
		if event == "SPELL_AURA_APPLIED" then
			if spellID == 115176 and dest == pName then -- ZEN MEDITATION
				spellinfo = GetSpellInfo(spellID)
				spelllinkinfo = GetSpellLink(spellID)
				RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo,}
				if RSA.db.profile.Monk.Spells.ZenMeditation.Messages.Start ~= "" then
					if RSA.db.profile.Monk.Spells.ZenMeditation.Local == true then
						RSA_Print_LibSink(string.gsub(RSA.db.profile.Monk.Spells.ZenMeditation.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.ZenMeditation.CustomChannel.Enabled == true then
						RSA_Print_Channel(string.gsub(RSA.db.profile.Monk.Spells.ZenMeditation.Messages.Start, ".%a+.", RSA_String_Replace), RSA.db.profile.Monk.Spells.ZenMeditation.CustomChannel.Channel)
					end
					if RSA.db.profile.Monk.Spells.ZenMeditation.Smart.Say == true then
						RSA_Print_Say(string.gsub(RSA.db.profile.Monk.Spells.ZenMeditation.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.ZenMeditation.Smart.RaidParty == true then
						RSA_Print_Smart_RaidParty(string.gsub(RSA.db.profile.Monk.Spells.ZenMeditation.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.ZenMeditation.Party == true then
						if RSA.db.profile.Monk.Spells.ZenMeditation.Smart.RaidParty == true and GetNumGroupMembers() == 0 and InstanceType ~= "arena" then return end
							RSA_Print_Party(string.gsub(RSA.db.profile.Monk.Spells.ZenMeditation.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.ZenMeditation.Raid == true then
						if RSA.db.profile.Monk.Spells.ZenMeditation.Smart.RaidParty == true and GetNumGroupMembers() > 0 then return end
						RSA_Print_Raid(string.gsub(RSA.db.profile.Monk.Spells.ZenMeditation.Messages.Start, ".%a+.", RSA_String_Replace))
					end
				end
			end -- ZEN MEDITATION
			if spellID == 116189 then -- PROVOKE
				spellinfo = GetSpellInfo(spellID)
				spelllinkinfo = GetSpellLink(spellID)
				RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo, ["[TARGET]"] = dest,}
				if RSA.db.profile.Monk.Spells.Provoke.Messages.Start ~= "" then
					if RSA.db.profile.Monk.Spells.Provoke.Local == true then
						RSA_Print_LibSink(string.gsub(RSA.db.profile.Monk.Spells.Provoke.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Provoke.CustomChannel.Enabled == true then
						RSA_Print_Channel(string.gsub(RSA.db.profile.Monk.Spells.Provoke.Messages.Start, ".%a+.", RSA_String_Replace), RSA.db.profile.Monk.Spells.Provoke.CustomChannel.Channel)
					end
					if RSA.db.profile.Monk.Spells.Provoke.Smart.Say == true then
						RSA_Print_Say(string.gsub(RSA.db.profile.Monk.Spells.Provoke.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Provoke.Smart.RaidParty == true then
						RSA_Print_Smart_RaidParty(string.gsub(RSA.db.profile.Monk.Spells.Provoke.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Provoke.Party == true then
						if RSA.db.profile.Monk.Spells.Provoke.Smart.RaidParty == true and GetNumGroupMembers() == 0 and InstanceType ~= "arena" then return end
							RSA_Print_Party(string.gsub(RSA.db.profile.Monk.Spells.Provoke.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Provoke.Raid == true then
						if RSA.db.profile.Monk.Spells.Provoke.Smart.RaidParty == true and GetNumGroupMembers() > 0 then return end
						RSA_Print_Raid(string.gsub(RSA.db.profile.Monk.Spells.Provoke.Messages.Start, ".%a+.", RSA_String_Replace))
					end
				end
			end -- PROVOKE
			if spellID == 120954 then -- FORTIFYING BREW
				spellinfo = GetSpellInfo(spellID)
				spelllinkinfo = GetSpellLink(spellID)
				RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo,}
				if RSA.db.profile.Monk.Spells.FortifyingBrew.Messages.Start ~= "" then
					if RSA.db.profile.Monk.Spells.FortifyingBrew.Local == true then
						RSA_Print_LibSink(string.gsub(RSA.db.profile.Monk.Spells.FortifyingBrew.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.FortifyingBrew.CustomChannel.Enabled == true then
						RSA_Print_Channel(string.gsub(RSA.db.profile.Monk.Spells.FortifyingBrew.Messages.Start, ".%a+.", RSA_String_Replace), RSA.db.profile.Monk.Spells.FortifyingBrew.CustomChannel.Channel)
					end
					if RSA.db.profile.Monk.Spells.FortifyingBrew.Smart.Say == true then
						RSA_Print_Say(string.gsub(RSA.db.profile.Monk.Spells.FortifyingBrew.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.FortifyingBrew.Smart.RaidParty == true then
						RSA_Print_Smart_RaidParty(string.gsub(RSA.db.profile.Monk.Spells.FortifyingBrew.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.FortifyingBrew.Party == true then
						if RSA.db.profile.Monk.Spells.FortifyingBrew.Smart.RaidParty == true and GetNumGroupMembers() == 0 and InstanceType ~= "arena" then return end
							RSA_Print_Party(string.gsub(RSA.db.profile.Monk.Spells.FortifyingBrew.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.FortifyingBrew.Raid == true then
						if RSA.db.profile.Monk.Spells.FortifyingBrew.Smart.RaidParty == true and GetNumGroupMembers() > 0 then return end
						RSA_Print_Raid(string.gsub(RSA.db.profile.Monk.Spells.FortifyingBrew.Messages.Start, ".%a+.", RSA_String_Replace))
					end
				end
			end -- FORTIFYING BREW
			if spellID == 115078 then -- PARALYSIS
				spellinfo = GetSpellInfo(spellID)
				spelllinkinfo = GetSpellLink(spellID)
				RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo, ["[TARGET]"] = dest,}
				if RSA.db.profile.Monk.Spells.Paralysis.Messages.Start ~= "" then
					if RSA.db.profile.Monk.Spells.Paralysis.Local == true then
						RSA_Print_LibSink(string.gsub(RSA.db.profile.Monk.Spells.Paralysis.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Paralysis.CustomChannel.Enabled == true then
						RSA_Print_Channel(string.gsub(RSA.db.profile.Monk.Spells.Paralysis.Messages.Start, ".%a+.", RSA_String_Replace), RSA.db.profile.Monk.Spells.Paralysis.CustomChannel.Channel)
					end
					if RSA.db.profile.Monk.Spells.Paralysis.Smart.Say == true then
						RSA_Print_Say(string.gsub(RSA.db.profile.Monk.Spells.Paralysis.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Paralysis.Smart.RaidParty == true then
						RSA_Print_Smart_RaidParty(string.gsub(RSA.db.profile.Monk.Spells.Paralysis.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Paralysis.Party == true then
						if RSA.db.profile.Monk.Spells.Paralysis.Smart.RaidParty == true and GetNumGroupMembers() == 0 and InstanceType ~= "arena" then return end
							RSA_Print_Party(string.gsub(RSA.db.profile.Monk.Spells.Paralysis.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Paralysis.Raid == true then
						if RSA.db.profile.Monk.Spells.Paralysis.Smart.RaidParty == true and GetNumGroupMembers() > 0 then return end
						RSA_Print_Raid(string.gsub(RSA.db.profile.Monk.Spells.Paralysis.Messages.Start, ".%a+.", RSA_String_Replace))
					end
				end
			end -- PARALYSIS
			if spellID == 115213 and dest == pName then -- AVERT HARM
				spellinfo = GetSpellInfo(spellID)
				spelllinkinfo = GetSpellLink(spellID)
				RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo, ["[TARGET]"] = dest,}
				if RSA.db.profile.Monk.Spells.AvertHarm.Messages.Start ~= "" then
					if RSA.db.profile.Monk.Spells.AvertHarm.Local == true then
						RSA_Print_LibSink(string.gsub(RSA.db.profile.Monk.Spells.AvertHarm.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.AvertHarm.CustomChannel.Enabled == true then
						RSA_Print_Channel(string.gsub(RSA.db.profile.Monk.Spells.AvertHarm.Messages.Start, ".%a+.", RSA_String_Replace), RSA.db.profile.Monk.Spells.AvertHarm.CustomChannel.Channel)
					end
					if RSA.db.profile.Monk.Spells.AvertHarm.Smart.Say == true then
						RSA_Print_Say(string.gsub(RSA.db.profile.Monk.Spells.AvertHarm.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.AvertHarm.Smart.RaidParty == true then
						RSA_Print_Smart_RaidParty(string.gsub(RSA.db.profile.Monk.Spells.AvertHarm.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.AvertHarm.Party == true then
						if RSA.db.profile.Monk.Spells.AvertHarm.Smart.RaidParty == true and GetNumGroupMembers() == 0 and InstanceType ~= "arena" then return end
							RSA_Print_Party(string.gsub(RSA.db.profile.Monk.Spells.AvertHarm.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.AvertHarm.Raid == true then
						if RSA.db.profile.Monk.Spells.AvertHarm.Smart.RaidParty == true and GetNumGroupMembers() > 0 then return end
						RSA_Print_Raid(string.gsub(RSA.db.profile.Monk.Spells.AvertHarm.Messages.Start, ".%a+.", RSA_String_Replace))
					end
				end
			end -- AVERT HARM
			if spellID == 115295 then -- GUARD
				spellinfo = GetSpellInfo(spellID)
				spelllinkinfo = GetSpellLink(spellID)
				RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo, ["[TARGET]"] = dest,}
				if RSA.db.profile.Monk.Spells.Guard.Messages.Start ~= "" then
					if RSA.db.profile.Monk.Spells.Guard.Local == true then
						RSA_Print_LibSink(string.gsub(RSA.db.profile.Monk.Spells.Guard.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Guard.CustomChannel.Enabled == true then
						RSA_Print_Channel(string.gsub(RSA.db.profile.Monk.Spells.Guard.Messages.Start, ".%a+.", RSA_String_Replace), RSA.db.profile.Monk.Spells.Guard.CustomChannel.Channel)
					end
					if RSA.db.profile.Monk.Spells.Guard.Smart.Say == true then
						RSA_Print_Say(string.gsub(RSA.db.profile.Monk.Spells.Guard.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Guard.Smart.RaidParty == true then
						RSA_Print_Smart_RaidParty(string.gsub(RSA.db.profile.Monk.Spells.Guard.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Guard.Party == true then
						if RSA.db.profile.Monk.Spells.Guard.Smart.RaidParty == true and GetNumGroupMembers() == 0 and InstanceType ~= "arena" then return end
							RSA_Print_Party(string.gsub(RSA.db.profile.Monk.Spells.Guard.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Guard.Raid == true then
						if RSA.db.profile.Monk.Spells.Guard.Smart.RaidParty == true and GetNumGroupMembers() > 0 then return end
						RSA_Print_Raid(string.gsub(RSA.db.profile.Monk.Spells.Guard.Messages.Start, ".%a+.", RSA_String_Replace))
					end
				end
			end -- GUARD
			if spellID == 115308 then -- ELUSIVE BREW
				spellinfo = GetSpellInfo(spellID)
				spelllinkinfo = GetSpellLink(spellID)
				RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo, ["[TARGET]"] = dest,}
				if RSA.db.profile.Monk.Spells.ElusiveBrew.Messages.Start ~= "" then
					if RSA.db.profile.Monk.Spells.ElusiveBrew.Local == true then
						RSA_Print_LibSink(string.gsub(RSA.db.profile.Monk.Spells.ElusiveBrew.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.ElusiveBrew.CustomChannel.Enabled == true then
						RSA_Print_Channel(string.gsub(RSA.db.profile.Monk.Spells.ElusiveBrew.Messages.Start, ".%a+.", RSA_String_Replace), RSA.db.profile.Monk.Spells.ElusiveBrew.CustomChannel.Channel)
					end
					if RSA.db.profile.Monk.Spells.ElusiveBrew.Smart.Say == true then
						RSA_Print_Say(string.gsub(RSA.db.profile.Monk.Spells.ElusiveBrew.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.ElusiveBrew.Smart.RaidParty == true then
						RSA_Print_Smart_RaidParty(string.gsub(RSA.db.profile.Monk.Spells.ElusiveBrew.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.ElusiveBrew.Party == true then
						if RSA.db.profile.Monk.Spells.ElusiveBrew.Smart.RaidParty == true and GetNumGroupMembers() == 0 and InstanceType ~= "arena" then return end
							RSA_Print_Party(string.gsub(RSA.db.profile.Monk.Spells.ElusiveBrew.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.ElusiveBrew.Raid == true then
						if RSA.db.profile.Monk.Spells.ElusiveBrew.Smart.RaidParty == true and GetNumGroupMembers() > 0 then return end
						RSA_Print_Raid(string.gsub(RSA.db.profile.Monk.Spells.ElusiveBrew.Messages.Start, ".%a+.", RSA_String_Replace))
					end
				end
			end -- ELUSIVE BREW
			if spellID == 122278 then -- DAMPEN HARM
				spellinfo = GetSpellInfo(spellID)
				spelllinkinfo = GetSpellLink(spellID)
				RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo,}
				if RSA.db.profile.Monk.Spells.DampenHarm.Messages.Start ~= "" then
					if RSA.db.profile.Monk.Spells.DampenHarm.Local == true then
						RSA_Print_LibSink(string.gsub(RSA.db.profile.Monk.Spells.DampenHarm.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.DampenHarm.CustomChannel.Enabled == true then
						RSA_Print_Channel(string.gsub(RSA.db.profile.Monk.Spells.DampenHarm.Messages.Start, ".%a+.", RSA_String_Replace), RSA.db.profile.Monk.Spells.DampenHarm.CustomChannel.Channel)
					end
					if RSA.db.profile.Monk.Spells.DampenHarm.Smart.Say == true then
						RSA_Print_Say(string.gsub(RSA.db.profile.Monk.Spells.DampenHarm.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.DampenHarm.Smart.RaidParty == true then
						RSA_Print_Smart_RaidParty(string.gsub(RSA.db.profile.Monk.Spells.DampenHarm.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.DampenHarm.Party == true then
						if RSA.db.profile.Monk.Spells.DampenHarm.Smart.RaidParty == true and GetNumGroupMembers() == 0 and InstanceType ~= "arena" then return end
							RSA_Print_Party(string.gsub(RSA.db.profile.Monk.Spells.DampenHarm.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.DampenHarm.Raid == true then
						if RSA.db.profile.Monk.Spells.DampenHarm.Smart.RaidParty == true and GetNumGroupMembers() > 0 then return end
						RSA_Print_Raid(string.gsub(RSA.db.profile.Monk.Spells.DampenHarm.Messages.Start, ".%a+.", RSA_String_Replace))
					end
				end
			end -- DAMPEN HARM
			if spellID == 116849 then -- LIFE COCOON
				spellinfo = GetSpellInfo(spellID)
				spelllinkinfo = GetSpellLink(spellID)
				RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo, ["[TARGET]"] = dest,}
				if RSA.db.profile.Monk.Spells.LifeCocoon.Messages.Start ~= "" then
					if RSA.db.profile.Monk.Spells.LifeCocoon.Local == true then
						RSA_Print_LibSink(string.gsub(RSA.db.profile.Monk.Spells.LifeCocoon.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.LifeCocoon.Whisper == true and dest ~= pName and RSA_Whisperable(destGUID) then
						RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo, ["[TARGET]"] = L["You"],}
						RSA_Print_Whisper(string.gsub(RSA.db.profile.Monk.Spells.LifeCocoon.Messages.Start, ".%a+.", RSA_String_Replace), dest)
						RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo, ["[TARGET]"] = dest,}
					end
					if RSA.db.profile.Monk.Spells.LifeCocoon.CustomChannel.Enabled == true then
						RSA_Print_Channel(string.gsub(RSA.db.profile.Monk.Spells.LifeCocoon.Messages.Start, ".%a+.", RSA_String_Replace), RSA.db.profile.Monk.Spells.LifeCocoon.CustomChannel.Channel)
					end
					if RSA.db.profile.Monk.Spells.LifeCocoon.Smart.Say == true then
						RSA_Print_Say(string.gsub(RSA.db.profile.Monk.Spells.LifeCocoon.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.LifeCocoon.Smart.RaidParty == true then
						RSA_Print_Smart_RaidParty(string.gsub(RSA.db.profile.Monk.Spells.LifeCocoon.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.LifeCocoon.Party == true then
						if RSA.db.profile.Monk.Spells.LifeCocoon.Smart.RaidParty == true and GetNumGroupMembers() == 0 and InstanceType ~= "arena" then return end
							RSA_Print_Party(string.gsub(RSA.db.profile.Monk.Spells.LifeCocoon.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.LifeCocoon.Raid == true then
						if RSA.db.profile.Monk.Spells.LifeCocoon.Smart.RaidParty == true and GetNumGroupMembers() > 0 then return end
						RSA_Print_Raid(string.gsub(RSA.db.profile.Monk.Spells.LifeCocoon.Messages.Start, ".%a+.", RSA_String_Replace))
					end
				end
			end -- LIFE COCOON
			if spellID == 122783 then -- DIFFUSE MAGIC
				spellinfo = GetSpellInfo(spellID)
				spelllinkinfo = GetSpellLink(spellID)
				RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo,}
				if RSA.db.profile.Monk.Spells.DiffuseMagic.Messages.Start ~= "" then
					if RSA.db.profile.Monk.Spells.DiffuseMagic.Local == true then
						RSA_Print_LibSink(string.gsub(RSA.db.profile.Monk.Spells.DiffuseMagic.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.DiffuseMagic.CustomChannel.Enabled == true then
						RSA_Print_Channel(string.gsub(RSA.db.profile.Monk.Spells.DiffuseMagic.Messages.Start, ".%a+.", RSA_String_Replace), RSA.db.profile.Monk.Spells.DiffuseMagic.CustomChannel.Channel)
					end
					if RSA.db.profile.Monk.Spells.DiffuseMagic.Smart.Say == true then
						RSA_Print_Say(string.gsub(RSA.db.profile.Monk.Spells.DiffuseMagic.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.DiffuseMagic.Smart.RaidParty == true then
						RSA_Print_Smart_RaidParty(string.gsub(RSA.db.profile.Monk.Spells.DiffuseMagic.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.DiffuseMagic.Party == true then
						if RSA.db.profile.Monk.Spells.DiffuseMagic.Smart.RaidParty == true and GetNumGroupMembers() == 0 and InstanceType ~= "arena" then return end
							RSA_Print_Party(string.gsub(RSA.db.profile.Monk.Spells.DiffuseMagic.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.DiffuseMagic.Raid == true then
						if RSA.db.profile.Monk.Spells.DiffuseMagic.Smart.RaidParty == true and GetNumGroupMembers() > 0 then return end
						RSA_Print_Raid(string.gsub(RSA.db.profile.Monk.Spells.DiffuseMagic.Messages.Start, ".%a+.", RSA_String_Replace))
					end
				end
			end -- DIFFUSE MAGIC
		end -- IF EVENT IS SPELL_AURA_APPLIED
		if event == "SPELL_AURA_REMOVED" then
			if spellID == 115176 and dest == pName then -- ZEN MEDITATION
				spellinfo = GetSpellInfo(spellID)
				spelllinkinfo = GetSpellLink(spellID)
				RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo,}
				if RSA.db.profile.Monk.Spells.ZenMeditation.Messages.End ~= "" then
					if RSA.db.profile.Monk.Spells.ZenMeditation.Local == true then
						RSA_Print_LibSink(string.gsub(RSA.db.profile.Monk.Spells.ZenMeditation.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.ZenMeditation.CustomChannel.Enabled == true then
						RSA_Print_Channel(string.gsub(RSA.db.profile.Monk.Spells.ZenMeditation.Messages.End, ".%a+.", RSA_String_Replace), RSA.db.profile.Monk.Spells.ZenMeditation.CustomChannel.Channel)
					end
					if RSA.db.profile.Monk.Spells.ZenMeditation.Smart.Say == true then
						RSA_Print_Say(string.gsub(RSA.db.profile.Monk.Spells.ZenMeditation.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.ZenMeditation.Smart.RaidParty == true then
						RSA_Print_Smart_RaidParty(string.gsub(RSA.db.profile.Monk.Spells.ZenMeditation.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.ZenMeditation.Party == true then
						if RSA.db.profile.Monk.Spells.ZenMeditation.Smart.RaidParty == true and GetNumGroupMembers() == 0 and InstanceType ~= "arena" then return end
							RSA_Print_Party(string.gsub(RSA.db.profile.Monk.Spells.ZenMeditation.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.ZenMeditation.Raid == true then
						if RSA.db.profile.Monk.Spells.ZenMeditation.Smart.RaidParty == true and GetNumGroupMembers() > 0 then return end
						RSA_Print_Raid(string.gsub(RSA.db.profile.Monk.Spells.ZenMeditation.Messages.End, ".%a+.", RSA_String_Replace))
					end
				end
			end -- ZEN MEDITATION
			if spellID == 120954 then -- FORTIFYING BREW
				spellinfo = GetSpellInfo(spellID)
				spelllinkinfo = GetSpellLink(spellID)
				RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo,}
				if RSA.db.profile.Monk.Spells.FortifyingBrew.Messages.End ~= "" then
					if RSA.db.profile.Monk.Spells.FortifyingBrew.Local == true then
						RSA_Print_LibSink(string.gsub(RSA.db.profile.Monk.Spells.FortifyingBrew.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.FortifyingBrew.CustomChannel.Enabled == true then
						RSA_Print_Channel(string.gsub(RSA.db.profile.Monk.Spells.FortifyingBrew.Messages.End, ".%a+.", RSA_String_Replace), RSA.db.profile.Monk.Spells.FortifyingBrew.CustomChannel.Channel)
					end
					if RSA.db.profile.Monk.Spells.FortifyingBrew.Smart.Say == true then
						RSA_Print_Say(string.gsub(RSA.db.profile.Monk.Spells.FortifyingBrew.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.FortifyingBrew.Smart.RaidParty == true then
						RSA_Print_Smart_RaidParty(string.gsub(RSA.db.profile.Monk.Spells.FortifyingBrew.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.FortifyingBrew.Party == true then
						if RSA.db.profile.Monk.Spells.FortifyingBrew.Smart.RaidParty == true and GetNumGroupMembers() == 0 and InstanceType ~= "arena" then return end
							RSA_Print_Party(string.gsub(RSA.db.profile.Monk.Spells.FortifyingBrew.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.FortifyingBrew.Raid == true then
						if RSA.db.profile.Monk.Spells.FortifyingBrew.Smart.RaidParty == true and GetNumGroupMembers() > 0 then return end
						RSA_Print_Raid(string.gsub(RSA.db.profile.Monk.Spells.FortifyingBrew.Messages.End, ".%a+.", RSA_String_Replace))
					end
				end
			end -- FORTIFYING BREW
			if spellID == 115078 then -- PARALYSIS
				spellinfo = GetSpellInfo(spellID)
				spelllinkinfo = GetSpellLink(spellID)
				RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo, ["[TARGET]"] = dest,}
				if RSA.db.profile.Monk.Spells.Paralysis.Messages.End ~= "" then
					if RSA.db.profile.Monk.Spells.Paralysis.Local == true then
						RSA_Print_LibSink(string.gsub(RSA.db.profile.Monk.Spells.Paralysis.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Paralysis.CustomChannel.Enabled == true then
						RSA_Print_Channel(string.gsub(RSA.db.profile.Monk.Spells.Paralysis.Messages.End, ".%a+.", RSA_String_Replace), RSA.db.profile.Monk.Spells.Paralysis.CustomChannel.Channel)
					end
					if RSA.db.profile.Monk.Spells.Paralysis.Smart.Say == true then
						RSA_Print_Say(string.gsub(RSA.db.profile.Monk.Spells.Paralysis.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Paralysis.Smart.RaidParty == true then
						RSA_Print_Smart_RaidParty(string.gsub(RSA.db.profile.Monk.Spells.Paralysis.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Paralysis.Party == true then
						if RSA.db.profile.Monk.Spells.Paralysis.Smart.RaidParty == true and GetNumGroupMembers() == 0 and InstanceType ~= "arena" then return end
							RSA_Print_Party(string.gsub(RSA.db.profile.Monk.Spells.Paralysis.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Paralysis.Raid == true then
						if RSA.db.profile.Monk.Spells.Paralysis.Smart.RaidParty == true and GetNumGroupMembers() > 0 then return end
						RSA_Print_Raid(string.gsub(RSA.db.profile.Monk.Spells.Paralysis.Messages.End, ".%a+.", RSA_String_Replace))
					end
				end
			end -- PARALYSIS
			if spellID == 115213 and dest == pName then -- AVERT HARM
				spellinfo = GetSpellInfo(spellID)
				spelllinkinfo = GetSpellLink(spellID)
				RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo, ["[TARGET]"] = dest,}
				if RSA.db.profile.Monk.Spells.AvertHarm.Messages.End ~= "" then
					if RSA.db.profile.Monk.Spells.AvertHarm.Local == true then
						RSA_Print_LibSink(string.gsub(RSA.db.profile.Monk.Spells.AvertHarm.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.AvertHarm.CustomChannel.Enabled == true then
						RSA_Print_Channel(string.gsub(RSA.db.profile.Monk.Spells.AvertHarm.Messages.End, ".%a+.", RSA_String_Replace), RSA.db.profile.Monk.Spells.AvertHarm.CustomChannel.Channel)
					end
					if RSA.db.profile.Monk.Spells.AvertHarm.Smart.Say == true then
						RSA_Print_Say(string.gsub(RSA.db.profile.Monk.Spells.AvertHarm.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.AvertHarm.Smart.RaidParty == true then
						RSA_Print_Smart_RaidParty(string.gsub(RSA.db.profile.Monk.Spells.AvertHarm.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.AvertHarm.Party == true then
						if RSA.db.profile.Monk.Spells.AvertHarm.Smart.RaidParty == true and GetNumGroupMembers() == 0 and InstanceType ~= "arena" then return end
							RSA_Print_Party(string.gsub(RSA.db.profile.Monk.Spells.AvertHarm.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.AvertHarm.Raid == true then
						if RSA.db.profile.Monk.Spells.AvertHarm.Smart.RaidParty == true and GetNumGroupMembers() > 0 then return end
						RSA_Print_Raid(string.gsub(RSA.db.profile.Monk.Spells.AvertHarm.Messages.End, ".%a+.", RSA_String_Replace))
					end
				end
			end -- AVERT HARM
			if spellID == 115295 then -- GUARD
				spellinfo = GetSpellInfo(spellID)
				spelllinkinfo = GetSpellLink(spellID)
				RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo, ["[TARGET]"] = dest,}
				if RSA.db.profile.Monk.Spells.Guard.Messages.End ~= "" then
					if RSA.db.profile.Monk.Spells.Guard.Local == true then
						RSA_Print_LibSink(string.gsub(RSA.db.profile.Monk.Spells.Guard.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Guard.CustomChannel.Enabled == true then
						RSA_Print_Channel(string.gsub(RSA.db.profile.Monk.Spells.Guard.Messages.End, ".%a+.", RSA_String_Replace), RSA.db.profile.Monk.Spells.Guard.CustomChannel.Channel)
					end
					if RSA.db.profile.Monk.Spells.Guard.Smart.Say == true then
						RSA_Print_Say(string.gsub(RSA.db.profile.Monk.Spells.Guard.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Guard.Smart.RaidParty == true then
						RSA_Print_Smart_RaidParty(string.gsub(RSA.db.profile.Monk.Spells.Guard.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Guard.Party == true then
						if RSA.db.profile.Monk.Spells.Guard.Smart.RaidParty == true and GetNumGroupMembers() == 0 and InstanceType ~= "arena" then return end
							RSA_Print_Party(string.gsub(RSA.db.profile.Monk.Spells.Guard.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Guard.Raid == true then
						if RSA.db.profile.Monk.Spells.Guard.Smart.RaidParty == true and GetNumGroupMembers() > 0 then return end
						RSA_Print_Raid(string.gsub(RSA.db.profile.Monk.Spells.Guard.Messages.End, ".%a+.", RSA_String_Replace))
					end
				end
			end -- GUARD
			if spellID == 115308 then -- ELUSIVE BREW
				spellinfo = GetSpellInfo(spellID)
				spelllinkinfo = GetSpellLink(spellID)
				RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo,}
				if RSA.db.profile.Monk.Spells.ElusiveBrew.Messages.End ~= "" then
					if RSA.db.profile.Monk.Spells.ElusiveBrew.Local == true then
						RSA_Print_LibSink(string.gsub(RSA.db.profile.Monk.Spells.ElusiveBrew.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.ElusiveBrew.CustomChannel.Enabled == true then
						RSA_Print_Channel(string.gsub(RSA.db.profile.Monk.Spells.ElusiveBrew.Messages.End, ".%a+.", RSA_String_Replace), RSA.db.profile.Monk.Spells.ElusiveBrew.CustomChannel.Channel)
					end
					if RSA.db.profile.Monk.Spells.ElusiveBrew.Smart.Say == true then
						RSA_Print_Say(string.gsub(RSA.db.profile.Monk.Spells.ElusiveBrew.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.ElusiveBrew.Smart.RaidParty == true then
						RSA_Print_Smart_RaidParty(string.gsub(RSA.db.profile.Monk.Spells.ElusiveBrew.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.ElusiveBrew.Party == true then
						if RSA.db.profile.Monk.Spells.ElusiveBrew.Smart.RaidParty == true and GetNumGroupMembers() == 0 and InstanceType ~= "arena" then return end
							RSA_Print_Party(string.gsub(RSA.db.profile.Monk.Spells.ElusiveBrew.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.ElusiveBrew.Raid == true then
						if RSA.db.profile.Monk.Spells.ElusiveBrew.Smart.RaidParty == true and GetNumGroupMembers() > 0 then return end
						RSA_Print_Raid(string.gsub(RSA.db.profile.Monk.Spells.ElusiveBrew.Messages.End, ".%a+.", RSA_String_Replace))
					end
				end
			end -- ELUSIVE BREW
			if spellID == 122278 then -- DAMPEN HARM
				spellinfo = GetSpellInfo(spellID)
				spelllinkinfo = GetSpellLink(spellID)
				RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo,}
				if RSA.db.profile.Monk.Spells.DampenHarm.Messages.End ~= "" then
					if RSA.db.profile.Monk.Spells.DampenHarm.Local == true then
						RSA_Print_LibSink(string.gsub(RSA.db.profile.Monk.Spells.DampenHarm.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.DampenHarm.CustomChannel.Enabled == true then
						RSA_Print_Channel(string.gsub(RSA.db.profile.Monk.Spells.DampenHarm.Messages.End, ".%a+.", RSA_String_Replace), RSA.db.profile.Monk.Spells.DampenHarm.CustomChannel.Channel)
					end
					if RSA.db.profile.Monk.Spells.DampenHarm.Smart.Say == true then
						RSA_Print_Say(string.gsub(RSA.db.profile.Monk.Spells.DampenHarm.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.DampenHarm.Smart.RaidParty == true then
						RSA_Print_Smart_RaidParty(string.gsub(RSA.db.profile.Monk.Spells.DampenHarm.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.DampenHarm.Party == true then
						if RSA.db.profile.Monk.Spells.DampenHarm.Smart.RaidParty == true and GetNumGroupMembers() == 0 and InstanceType ~= "arena" then return end
							RSA_Print_Party(string.gsub(RSA.db.profile.Monk.Spells.DampenHarm.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.DampenHarm.Raid == true then
						if RSA.db.profile.Monk.Spells.DampenHarm.Smart.RaidParty == true and GetNumGroupMembers() > 0 then return end
						RSA_Print_Raid(string.gsub(RSA.db.profile.Monk.Spells.DampenHarm.Messages.End, ".%a+.", RSA_String_Replace))
					end
				end
			end -- DAMPEN HARM
			if spellID == 116849 then -- LIFE COCOON
				spellinfo = GetSpellInfo(spellID)
				spelllinkinfo = GetSpellLink(spellID)
				RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo, ["[TARGET]"] = dest,}
				if RSA.db.profile.Monk.Spells.LifeCocoon.Messages.End ~= "" then
					if RSA.db.profile.Monk.Spells.LifeCocoon.Local == true then
						RSA_Print_LibSink(string.gsub(RSA.db.profile.Monk.Spells.LifeCocoon.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.DiffuseMagic.Whisper == true and dest ~= pName and RSA_Whisperable(destGUID) then
						RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo, ["[TARGET]"] = L["You"],}
						RSA_Print_Whisper(string.gsub(RSA.db.profile.Monk.Spells.DiffuseMagic.Messages.Start, ".%a+.", RSA_String_Replace), dest)
						RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo, ["[TARGET]"] = dest,}
					end
					if RSA.db.profile.Monk.Spells.LifeCocoon.CustomChannel.Enabled == true then
						RSA_Print_Channel(string.gsub(RSA.db.profile.Monk.Spells.LifeCocoon.Messages.End, ".%a+.", RSA_String_Replace), RSA.db.profile.Monk.Spells.LifeCocoon.CustomChannel.Channel)
					end
					if RSA.db.profile.Monk.Spells.LifeCocoon.Smart.Say == true then
						RSA_Print_Say(string.gsub(RSA.db.profile.Monk.Spells.LifeCocoon.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.LifeCocoon.Smart.RaidParty == true then
						RSA_Print_Smart_RaidParty(string.gsub(RSA.db.profile.Monk.Spells.LifeCocoon.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.LifeCocoon.Party == true then
						if RSA.db.profile.Monk.Spells.LifeCocoon.Smart.RaidParty == true and GetNumGroupMembers() == 0 and InstanceType ~= "arena" then return end
							RSA_Print_Party(string.gsub(RSA.db.profile.Monk.Spells.LifeCocoon.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.LifeCocoon.Raid == true then
						if RSA.db.profile.Monk.Spells.LifeCocoon.Smart.RaidParty == true and GetNumGroupMembers() > 0 then return end
						RSA_Print_Raid(string.gsub(RSA.db.profile.Monk.Spells.LifeCocoon.Messages.End, ".%a+.", RSA_String_Replace))
					end
				end
			end -- LIFE COCOON
			if spellID == 122783 then -- DIFFUSE MAGIC
				spellinfo = GetSpellInfo(spellID)
				spelllinkinfo = GetSpellLink(spellID)
				RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo,}
				if RSA.db.profile.Monk.Spells.DiffuseMagic.Messages.End ~= "" then
					if RSA.db.profile.Monk.Spells.DiffuseMagic.Local == true then
						RSA_Print_LibSink(string.gsub(RSA.db.profile.Monk.Spells.DiffuseMagic.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.DiffuseMagic.CustomChannel.Enabled == true then
						RSA_Print_Channel(string.gsub(RSA.db.profile.Monk.Spells.DiffuseMagic.Messages.End, ".%a+.", RSA_String_Replace), RSA.db.profile.Monk.Spells.DiffuseMagic.CustomChannel.Channel)
					end
					if RSA.db.profile.Monk.Spells.DiffuseMagic.Smart.Say == true then
						RSA_Print_Say(string.gsub(RSA.db.profile.Monk.Spells.DiffuseMagic.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.DiffuseMagic.Smart.RaidParty == true then
						RSA_Print_Smart_RaidParty(string.gsub(RSA.db.profile.Monk.Spells.DiffuseMagic.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.DiffuseMagic.Party == true then
						if RSA.db.profile.Monk.Spells.DiffuseMagic.Smart.RaidParty == true and GetNumGroupMembers() == 0 and InstanceType ~= "arena" then return end
							RSA_Print_Party(string.gsub(RSA.db.profile.Monk.Spells.DiffuseMagic.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.DiffuseMagic.Raid == true then
						if RSA.db.profile.Monk.Spells.DiffuseMagic.Smart.RaidParty == true and GetNumGroupMembers() > 0 then return end
						RSA_Print_Raid(string.gsub(RSA.db.profile.Monk.Spells.DiffuseMagic.Messages.End, ".%a+.", RSA_String_Replace))
					end
				end
			end -- DIFFUSE MAGIC
		end -- IF EVENT IS SPELL_AURA_REMOVED
		if event == "SPELL_INTERRUPT" then
			if spellID == 116709 then -- SPEAR HAND STRIKE
				spellinfo = GetSpellInfo(spellID)
				spelllinkinfo = GetSpellLink(spellID)
				extraspellinfo = GetSpellInfo(missType)
				extraspellinfolink = GetSpellLink(missType)
				RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo, ["[TARGET]"] = dest, ["[TARSPELL]"] = extraspellinfo, ["[TARLINK]"] = extraspellinfolink,}
				if RSA.db.profile.Monk.Spells.SpearHandStrike.Messages.Start ~= "" then
					if RSA.db.profile.Monk.Spells.SpearHandStrike.Local == true then
						RSA_Print_LibSink(string.gsub(RSA.db.profile.Monk.Spells.SpearHandStrike.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.SpearHandStrike.CustomChannel.Enabled == true then
						RSA_Print_Channel(string.gsub(RSA.db.profile.Monk.Spells.SpearHandStrike.Messages.Start, ".%a+.", RSA_String_Replace), RSA.db.profile.Monk.Spells.SpearHandStrike.CustomChannel.Channel)
					end
					if RSA.db.profile.Monk.Spells.SpearHandStrike.Smart.Say == true then
						RSA_Print_Say(string.gsub(RSA.db.profile.Monk.Spells.SpearHandStrike.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.SpearHandStrike.Smart.RaidParty == true then
						RSA_Print_Smart_RaidParty(string.gsub(RSA.db.profile.Monk.Spells.SpearHandStrike.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.SpearHandStrike.Party == true then
						if RSA.db.profile.Monk.Spells.SpearHandStrike.Smart.RaidParty == true and GetNumGroupMembers() == 0 and InstanceType ~= "arena" then return end
							RSA_Print_Party(string.gsub(RSA.db.profile.Monk.Spells.SpearHandStrike.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.SpearHandStrike.Raid == true then
						if RSA.db.profile.Monk.Spells.SpearHandStrike.Smart.RaidParty == true and GetNumGroupMembers() > 0 then return end
						RSA_Print_Raid(string.gsub(RSA.db.profile.Monk.Spells.SpearHandStrike.Messages.Start, ".%a+.", RSA_String_Replace))
					end
				end
			end -- SPEAR HAND STRIKE
		end -- IF EVENT IS SPELL_INTERRUPT
		if event == "SPELL_DISPEL" then
			if spellID == 115450 then -- DETOX
				spellinfo = GetSpellInfo(spellID)
				spelllinkinfo = GetSpellLink(spellID)
				extraspellinfo = GetSpellInfo(missType)
				extraspellinfolink = GetSpellLink(missType)
				RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo, ["[TARGET]"] = dest, ["[AURA]"] = extraspellinfo, ["[AURALINK]"] = extraspellinfolink,}
				if RSA.db.profile.Monk.Spells.Detox.Messages.Start ~= "" then
					if RSA.db.profile.Monk.Spells.Detox.Local == true then
						RSA_Print_LibSink(string.gsub(RSA.db.profile.Monk.Spells.Detox.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Detox.Whisper == true and dest ~= pName and RSA_Whisperable(destGUID) then
						RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo, ["[TARGET]"] = L["You"],}
						RSA_Print_Whisper(string.gsub(RSA.db.profile.Monk.Spells.Detox.Messages.End, ".%a+.", RSA_String_Replace), dest)
						RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo, ["[TARGET]"] = dest,}
					end
					if RSA.db.profile.Monk.Spells.Detox.CustomChannel.Enabled == true then
						RSA_Print_Channel(string.gsub(RSA.db.profile.Monk.Spells.Detox.Messages.Start, ".%a+.", RSA_String_Replace), RSA.db.profile.Monk.Spells.Detox.CustomChannel.Channel)
					end
					if RSA.db.profile.Monk.Spells.Detox.Smart.Say == true then
						RSA_Print_Say(string.gsub(RSA.db.profile.Monk.Spells.Detox.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Detox.Smart.RaidParty == true then
						RSA_Print_Smart_RaidParty(string.gsub(RSA.db.profile.Monk.Spells.Detox.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Detox.Party == true then
						if RSA.db.profile.Monk.Spells.Detox.Smart.RaidParty == true and GetNumGroupMembers() == 0 and InstanceType ~= "arena" then return end
							RSA_Print_Party(string.gsub(RSA.db.profile.Monk.Spells.Detox.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Detox.Raid == true then
						if RSA.db.profile.Monk.Spells.Detox.Smart.RaidParty == true and GetNumGroupMembers() > 0 then return end
						RSA_Print_Raid(string.gsub(RSA.db.profile.Monk.Spells.Detox.Messages.Start, ".%a+.", RSA_String_Replace))
					end
				end
			end -- DETOX
		end -- IF EVENT IS SPELL_DISPEL
		if event == "SPELL_HEAL" then
			
		end -- IF EVENT IS SPELL_HEAL
		if event == "SPELL_MISSED" and  missType ~= "Immune" then
			if spellID == 116189 then -- PROVOKE
				spellinfo = GetSpellInfo(spellID)
				spelllinkinfo = GetSpellLink(spellID)
				if missType == "MISS" then
					missinfo = L["missed"]
				elseif missType ~= "MISS" then
					missinfo = L["was resisted by"]
				end
				RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo, ["[TARGET]"] = dest, ["[MISSTYPE]"] = missinfo,}
				if RSA.db.profile.Monk.Spells.Provoke.Messages.End ~= "" then
					if RSA.db.profile.Monk.Spells.Provoke.Local == true then
						RSA_Print_LibSink(string.gsub(RSA.db.profile.Monk.Spells.Provoke.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Provoke.CustomChannel.Enabled == true then
						RSA_Print_Channel(string.gsub(RSA.db.profile.Monk.Spells.Provoke.Messages.End, ".%a+.", RSA_String_Replace), RSA.db.profile.Monk.Spells.Provoke.CustomChannel.Channel)
					end
					if RSA.db.profile.Monk.Spells.Provoke.Smart.Say == true then
						RSA_Print_Say(string.gsub(RSA.db.profile.Monk.Spells.Provoke.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Provoke.Smart.RaidParty == true then
						RSA_Print_Smart_RaidParty(string.gsub(RSA.db.profile.Monk.Spells.Provoke.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Provoke.Party == true then
						if RSA.db.profile.Monk.Spells.Provoke.Smart.RaidParty == true and GetNumGroupMembers() == 0 and InstanceType ~= "arena" then return end
							RSA_Print_Party(string.gsub(RSA.db.profile.Monk.Spells.Provoke.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Provoke.Raid == true then
						if RSA.db.profile.Monk.Spells.Provoke.Smart.RaidParty == true and GetNumGroupMembers() > 0 then return end
						RSA_Print_Raid(string.gsub(RSA.db.profile.Monk.Spells.Provoke.Messages.End, ".%a+.", RSA_String_Replace))
					end
				end
			end -- PROVOKE
			if spellID == 116709 then -- SPEAR HAND STRIKE
				spellinfo = GetSpellInfo(spellID)
				spelllinkinfo = GetSpellLink(spellID)
				if missType == "MISS" then
					missinfo = L["missed"]
				elseif missType ~= "MISS" then
					missinfo = L["was resisted by"]
				end
				RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo, ["[TARGET]"] = dest, ["[MISSTYPE]"] = missinfo,}
				if RSA.db.profile.Monk.Spells.SpearHandStrike.Messages.Immune ~= "" then
					if RSA.db.profile.Monk.Spells.SpearHandStrike.Local == true then
						RSA_Print_LibSink(string.gsub(RSA.db.profile.Monk.Spells.SpearHandStrike.Messages.Immune, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.SpearHandStrike.CustomChannel.Enabled == true then
						RSA_Print_Channel(string.gsub(RSA.db.profile.Monk.Spells.SpearHandStrike.Messages.Immune, ".%a+.", RSA_String_Replace), RSA.db.profile.Monk.Spells.SpearHandStrike.CustomChannel.Channel)
					end
					if RSA.db.profile.Monk.Spells.SpearHandStrike.Smart.Say == true then
						RSA_Print_Say(string.gsub(RSA.db.profile.Monk.Spells.SpearHandStrike.Messages.Immune, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.SpearHandStrike.Smart.RaidParty == true then
						RSA_Print_Smart_RaidParty(string.gsub(RSA.db.profile.Monk.Spells.SpearHandStrike.Messages.Immune, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.SpearHandStrike.Party == true then
						if RSA.db.profile.Monk.Spells.SpearHandStrike.Smart.RaidParty == true and GetNumGroupMembers() == 0 and InstanceType ~= "arena" then return end
							RSA_Print_Party(string.gsub(RSA.db.profile.Monk.Spells.SpearHandStrike.Messages.Immune, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.SpearHandStrike.Raid == true then
						if RSA.db.profile.Monk.Spells.SpearHandStrike.Smart.RaidParty == true and GetNumGroupMembers() > 0 then return end
						RSA_Print_Raid(string.gsub(RSA.db.profile.Monk.Spells.SpearHandStrike.Messages.Immune, ".%a+.", RSA_String_Replace))
					end
				end
			end -- SPEAR HAND STRIKE
			if spellID == 115078 then -- PARALYSIS
				spellinfo = GetSpellInfo(spellID)
				spelllinkinfo = GetSpellLink(spellID)
				if missType == "MISS" then
					missinfo = L["missed"]
				elseif missType ~= "MISS" then
					missinfo = L["was resisted by"]
				end
				RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo, ["[TARGET]"] = dest, ["[MISSTYPE]"] = missinfo,}
				if RSA.db.profile.Monk.Spells.Paralysis.Messages.Immune ~= "" then
					if RSA.db.profile.Monk.Spells.Paralysis.Local == true then
						RSA_Print_LibSink(string.gsub(RSA.db.profile.Monk.Spells.Paralysis.Messages.Immune, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Paralysis.CustomChannel.Enabled == true then
						RSA_Print_Channel(string.gsub(RSA.db.profile.Monk.Spells.Paralysis.Messages.Immune, ".%a+.", RSA_String_Replace), RSA.db.profile.Monk.Spells.Paralysis.CustomChannel.Channel)
					end
					if RSA.db.profile.Monk.Spells.Paralysis.Smart.Say == true then
						RSA_Print_Say(string.gsub(RSA.db.profile.Monk.Spells.Paralysis.Messages.Immune, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Paralysis.Smart.RaidParty == true then
						RSA_Print_Smart_RaidParty(string.gsub(RSA.db.profile.Monk.Spells.Paralysis.Messages.Immune, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Paralysis.Party == true then
						if RSA.db.profile.Monk.Spells.Paralysis.Smart.RaidParty == true and GetNumGroupMembers() == 0 and InstanceType ~= "arena" then return end
							RSA_Print_Party(string.gsub(RSA.db.profile.Monk.Spells.Paralysis.Messages.Immune, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Paralysis.Raid == true then
						if RSA.db.profile.Monk.Spells.Paralysis.Smart.RaidParty == true and GetNumGroupMembers() > 0 then return end
						RSA_Print_Raid(string.gsub(RSA.db.profile.Monk.Spells.Paralysis.Messages.Immune, ".%a+.", RSA_String_Replace))
					end
				end
			end -- PARALYSIS
		end -- IF EVENT IS SPELL_MISSED NOT Immune
		if event == "SPELL_MISSED" and  missType == "Immune" then
			if spellID == 116189 then -- PROVOKE
				spellinfo = GetSpellInfo(spellID)
				spelllinkinfo = GetSpellLink(spellID)
				RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo, ["[TARGET]"] = dest,}
				if RSA.db.profile.Monk.Spells.Provoke.Messages.Immune ~= "" then
					if RSA.db.profile.Monk.Spells.Provoke.Local == true then
						RSA_Print_LibSink(string.gsub(RSA.db.profile.Monk.Spells.Provoke.Messages.Immune, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Provoke.CustomChannel.Enabled == true then
						RSA_Print_Channel(string.gsub(RSA.db.profile.Monk.Spells.Provoke.Messages.Immune, ".%a+.", RSA_String_Replace), RSA.db.profile.Monk.Spells.Provoke.CustomChannel.Channel)
					end
					if RSA.db.profile.Monk.Spells.Provoke.Smart.Say == true then
						RSA_Print_Say(string.gsub(RSA.db.profile.Monk.Spells.Provoke.Messages.Immune, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Provoke.Smart.RaidParty == true then
						RSA_Print_Smart_RaidParty(string.gsub(RSA.db.profile.Monk.Spells.Provoke.Messages.Immune, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Provoke.Party == true then
						if RSA.db.profile.Monk.Spells.Provoke.Smart.RaidParty == true and GetNumGroupMembers() == 0 and InstanceType ~= "arena" then return end
							RSA_Print_Party(string.gsub(RSA.db.profile.Monk.Spells.Provoke.Messages.Immune, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Provoke.Raid == true then
						if RSA.db.profile.Monk.Spells.Provoke.Smart.RaidParty == true and GetNumGroupMembers() > 0 then return end
						RSA_Print_Raid(string.gsub(RSA.db.profile.Monk.Spells.Provoke.Messages.Immune, ".%a+.", RSA_String_Replace))
					end
				end
			end -- PROVOKE
			if spellID == 116709 then -- SPEAR HAND STRIKE
				spellinfo = GetSpellInfo(spellID)
				spelllinkinfo = GetSpellLink(spellID)
				RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo, ["[TARGET]"] = dest, ["[MISSTYPE]"] = L["Immune"],}
				if RSA.db.profile.Monk.Spells.SpearHandStrike.Messages.Immune ~= "" then
					if RSA.db.profile.Monk.Spells.SpearHandStrike.Local == true then
						RSA_Print_LibSink(string.gsub(RSA.db.profile.Monk.Spells.SpearHandStrike.Messages.Immune, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.SpearHandStrike.CustomChannel.Enabled == true then
						RSA_Print_Channel(string.gsub(RSA.db.profile.Monk.Spells.SpearHandStrike.Messages.Immune, ".%a+.", RSA_String_Replace), RSA.db.profile.Monk.Spells.SpearHandStrike.CustomChannel.Channel)
					end
					if RSA.db.profile.Monk.Spells.SpearHandStrike.Smart.Say == true then
						RSA_Print_Say(string.gsub(RSA.db.profile.Monk.Spells.SpearHandStrike.Messages.Immune, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.SpearHandStrike.Smart.RaidParty == true then
						RSA_Print_Smart_RaidParty(string.gsub(RSA.db.profile.Monk.Spells.SpearHandStrike.Messages.Immune, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.SpearHandStrike.Party == true then
						if RSA.db.profile.Monk.Spells.SpearHandStrike.Smart.RaidParty == true and GetNumGroupMembers() == 0 and InstanceType ~= "arena" then return end
							RSA_Print_Party(string.gsub(RSA.db.profile.Monk.Spells.SpearHandStrike.Messages.Immune, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.SpearHandStrike.Raid == true then
						if RSA.db.profile.Monk.Spells.SpearHandStrike.Smart.RaidParty == true and GetNumGroupMembers() > 0 then return end
						RSA_Print_Raid(string.gsub(RSA.db.profile.Monk.Spells.SpearHandStrike.Messages.Immune, ".%a+.", RSA_String_Replace))
					end
				end
			end -- SPEAR HAND STRIKE
			if spellID == 115078 then -- PARALYSIS
				spellinfo = GetSpellInfo(spellID)
				spelllinkinfo = GetSpellLink(spellID)
				RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo, ["[TARGET]"] = dest, ["[MISSTYPE]"] = missinfo,}
				if RSA.db.profile.Monk.Spells.Paralysis.Messages.Immune ~= "" then
					if RSA.db.profile.Monk.Spells.Paralysis.Local == true then
						RSA_Print_LibSink(string.gsub(RSA.db.profile.Monk.Spells.Paralysis.Messages.Immune, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Paralysis.CustomChannel.Enabled == true then
						RSA_Print_Channel(string.gsub(RSA.db.profile.Monk.Spells.Paralysis.Messages.Immune, ".%a+.", RSA_String_Replace), RSA.db.profile.Monk.Spells.Paralysis.CustomChannel.Channel)
					end
					if RSA.db.profile.Monk.Spells.Paralysis.Smart.Say == true then
						RSA_Print_Say(string.gsub(RSA.db.profile.Monk.Spells.Paralysis.Messages.Immune, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Paralysis.Smart.RaidParty == true then
						RSA_Print_Smart_RaidParty(string.gsub(RSA.db.profile.Monk.Spells.Paralysis.Messages.Immune, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Paralysis.Party == true then
						if RSA.db.profile.Monk.Spells.Paralysis.Smart.RaidParty == true and GetNumGroupMembers() == 0 and InstanceType ~= "arena" then return end
							RSA_Print_Party(string.gsub(RSA.db.profile.Monk.Spells.Paralysis.Messages.Immune, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Paralysis.Raid == true then
						if RSA.db.profile.Monk.Spells.Paralysis.Smart.RaidParty == true and GetNumGroupMembers() > 0 then return end
						RSA_Print_Raid(string.gsub(RSA.db.profile.Monk.Spells.Paralysis.Messages.Immune, ".%a+.", RSA_String_Replace))
					end
				end
			end -- PARALYSIS
		end -- IF EVENT IS SPELL_MISSED AND IS Immune
	end -- IF SOURCE IS PLAYER
end -- END ENTIRELY
RSA_CombatLogMonitor:SetScript("OnEvent", Monk_Spells)
------------------------------
---- Resurrection Monitor ----
------------------------------
local function Monk_Resuscitate(_, event, source, spell, rank, dest, _)
	if UnitName(source) == pName then
		if spell == GetSpellInfo(115178) and RSA.db.profile.Monk.Spells.Resuscitate.Messages.Start ~= "" then -- RESUSCITATE
			if event == "UNIT_SPELLCAST_SENT" then
				Ressed = false
				if (dest == L["Unknown"] or dest == nil) then
					if UnitExists("target") ~= 1 or (UnitHealth("target") > 1 and UnitIsDeadOrGhost("target") ~= 1) then
						if GameTooltipTextLeft1:GetText() == nil then
							dest = L["Unknown"]
							ResTarget = L["Unknown"]
						else
							dest = string.gsub(GameTooltipTextLeft1:GetText(), L["Corpse of "], "")
							ResTarget = string.gsub(GameTooltipTextLeft1:GetText(), L["Corpse of "], "")
						end
					else
						dest = UnitName("target")
						ResTarget = UnitName("target")
					end
				else
					ResTarget = dest
				end
				spellinfo = GetSpellInfo(spell) spelllinkinfo = GetSpellLink(spell)
				RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo, ["[TARGET]"] = dest,}
				if RSA.db.profile.Monk.Spells.Resuscitate.Messages.Start ~= "" then
					if RSA.db.profile.Monk.Spells.Resuscitate.Local == true then
						RSA_Print_LibSink(string.gsub(RSA.db.profile.Monk.Spells.Resuscitate.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Resuscitate.Whisper == true and dest ~= pName then
						RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo, ["[TARGET]"] = L["You"],}
						RSA_Print_Whisper(string.gsub(RSA.db.profile.Monk.Spells.Resuscitate.Messages.Start, ".%a+.", RSA_String_Replace), dest)
						RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo, ["[TARGET]"] = dest,}
					end
					if RSA.db.profile.Monk.Spells.Resuscitate.CustomChannel.Enabled == true then
						RSA_Print_Channel(string.gsub(RSA.db.profile.Monk.Spells.Resuscitate.Messages.Start, ".%a+.", RSA_String_Replace), RSA.db.profile.Monk.Spells.Resuscitate.CustomChannel.Channel)
					end
					if RSA.db.profile.Monk.Spells.Resuscitate.Smart.Say == true then
						RSA_Print_Say(string.gsub(RSA.db.profile.Monk.Spells.Resuscitate.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Resuscitate.Smart.RaidParty == true then
						RSA_Print_Smart_RaidParty(string.gsub(RSA.db.profile.Monk.Spells.Resuscitate.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Resuscitate.Party == true then
						if RSA.db.profile.Monk.Spells.Resuscitate.Smart.RaidParty == true and GetNumGroupMembers() == 0 and InstanceType ~= "arena" then return end
							RSA_Print_Party(string.gsub(RSA.db.profile.Monk.Spells.Resuscitate.Messages.Start, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Resuscitate.Raid == true then
						if RSA.db.profile.Monk.Spells.Resuscitate.Smart.RaidParty == true and GetNumGroupMembers() > 0 then return end
						RSA_Print_Raid(string.gsub(RSA.db.profile.Monk.Spells.Resuscitate.Messages.Start, ".%a+.", RSA_String_Replace))
					end
				end
			elseif event == "UNIT_SPELLCAST_SUCCEEDED" and Ressed ~= true then
				dest = ResTarget
				Ressed = true
				if RSA.db.profile.Monk.Spells.Resuscitate.Messages.End ~= "" then
					if RSA.db.profile.Monk.Spells.Resuscitate.Local == true then
						RSA_Print_LibSink(string.gsub(RSA.db.profile.Monk.Spells.Resuscitate.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Resuscitate.Whisper == true and dest ~= pName then
						RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo, ["[TARGET]"] = L["You"],}
						RSA_Print_Whisper(string.gsub(RSA.db.profile.Monk.Spells.Resuscitate.Messages.End, ".%a+.", RSA_String_Replace), dest)
						RSA_Replacements = {["[SPELL]"] = spellinfo, ["[LINK]"] = spelllinkinfo, ["[TARGET]"] = dest,}
					end
					if RSA.db.profile.Monk.Spells.Resuscitate.CustomChannel.Enabled == true then
						RSA_Print_Channel(string.gsub(RSA.db.profile.Monk.Spells.Resuscitate.Messages.End, ".%a+.", RSA_String_Replace), RSA.db.profile.Monk.Spells.Resuscitate.CustomChannel.Channel)
					end
					if RSA.db.profile.Monk.Spells.Resuscitate.Smart.Say == true then
						RSA_Print_Say(string.gsub(RSA.db.profile.Monk.Spells.Resuscitate.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Resuscitate.Smart.RaidParty == true then
						RSA_Print_Smart_RaidParty(string.gsub(RSA.db.profile.Monk.Spells.Resuscitate.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Resuscitate.Party == true then
						if RSA.db.profile.Monk.Spells.Resuscitate.Smart.RaidParty == true and GetNumGroupMembers() == 0 and InstanceType ~= "arena" then return end
							RSA_Print_Party(string.gsub(RSA.db.profile.Monk.Spells.Resuscitate.Messages.End, ".%a+.", RSA_String_Replace))
					end
					if RSA.db.profile.Monk.Spells.Resuscitate.Raid == true then
						if RSA.db.profile.Monk.Spells.Resuscitate.Smart.RaidParty == true and GetNumGroupMembers() > 0 then return end
						RSA_Print_Raid(string.gsub(RSA.db.profile.Monk.Spells.Resuscitate.Messages.End, ".%a+.", RSA_String_Replace))
					end
				end
			end
		end -- RESUSCITATE
	end
end -- END FUNCTION
RSA_ResMon = CreateFrame("Frame", "RSA:RM")
RSA_ResMon:RegisterEvent("UNIT_SPELLCAST_SENT")
RSA_ResMon:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")
RSA_ResMon:SetScript("OnEvent", Monk_Resuscitate)
end -- END ON ENABLED
function RSA_Monk:OnDisable()
RSA_CombatLogMonitor:SetScript("OnEvent", nil)
end